<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>商品查询页</title>
<script src="${ctx }/js/artDialog.js?skin=gray"></script>
<script src="${ctx }/js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="${ctx }/js/jquery-1.3.2.js"></script>
<style type="text/css">
.thin_line_table { border:1px #0099CC solid;border-collapse:collapse;font-family: 宋体;font-size:12px }
.thin_line_table  td { border:1px #0099CC solid;border-collapse:collapse;text-align: center;}
.thin_line_table th { border:1px #0099CC solid;border-collapse:collapse;background-color:#CDE1ED }
</style>

<script type="text/javascript">

$(function(){

	$("#search_button").click(function(){
		$("#goods_search_form").submit();
    });

    $("#confirm_button").click(function(){

    	var goods_id = $('input[name="goods_id"]:checked').val();

		if( goods_id != undefined ){
		   var origin = art.dialog.open.origin;
		   
		   var parent_hidden_input = origin.document.getElementById('goods_id');
		   parent_hidden_input.value = goods_id; 

		   var parent_goods_name = origin.document.getElementById('goods_name');
		   var goods_name = $('input[name="goods_id"]:checked').attr("title");
		   parent_goods_name.value = goods_name;

		   var parent_title = origin.document.getElementById('title');
		   parent_title.value = goods_name;
		   
		}

		art.dialog.close();
    });
});
	
</script>
</head>

<body>

	<form action="" method="post" id="goods_search_form" name="goods_search_form">
		<div style="width: 680px;font-size: 12px;">
			作者：<input type="text" size="20" name="painter_name" value="${requestScope.painter_name}"/>
			&nbsp;&nbsp;作品名称：<input type="text" size="20" name="painting_title"  value="${requestScope.painting_title }"/>
			&nbsp;&nbsp;<input type="button" value="查询" id="search_button"  style="padding: 3px;"/>
		</div>
		<div style="margin-top: 20px;width: 680px;">
			<table cellpadding="0" cellspacing="0" class="thin_line_table" width="100%">
				<tr><th width="30" height="30"></th><th>名称</th><th>作者</th><th>上传时间</th></tr>
					<c:forEach items="${page.result}" var="result" varStatus="status">
						<tr>
							<td height="25"><input name="goods_id" type="radio" value="${result.id }" title="${result.name }"/></td>
							<td>${result.name }</td>
							<td>${result.painting.painter.name }</td>
							<td><fmt:formatDate value='${result.create_time }' pattern='yyyy-MM-dd HH:mm'/></td>
				    	</tr>
				    </c:forEach>
				  <tr><td colspan="100%" align="center"><jsp:include page="/commons/paging_footer.jsp"/></td></tr>
			</table>
		</div>
		<div style="text-align: center;width: 680px;margin-top: 10px;">
			<input type="button" id="confirm_button" value="确定" name="confirm_button" style="padding: 5px;"/>
		</div>
	</form>
	
</body>

</html>